<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>{dreamer-cms:global name="title" /}-{dreamer-cms:category field="typenamecn" /}</title>
    <link rel="icon" href="{dreamer-cms:template /}images/favicon.ico" />
    <meta name="Keywords" content="{dreamer-cms:global name='keywords' /}" />
    <meta name="Description" content="{dreamer-cms:global name='describe' /}" />
    <link href="{dreamer-cms:template /}css/output.css" rel="stylesheet" />
    <link rel="stylesheet" href="{dreamer-cms:template /}css/variables.css" />
  </head>
  <body class="bg-white">
    <!-- 导航栏 -->
    <div class="sticky top-0 z-50">
      {dreamer-cms:include file='inc/header.html'/}
    </div>
    <main class="container mx-auto px-4 md:px-52">
      <img src='{dreamer-cms:topcategory field="typeimg" /}' class="w-full mb-4 md:mb-12" alt="">
      <div class="w-full mt-0 lg:mt-12 pb-4 lg:pb-12  border-b-2 border-[#757575]">
        <p class=" text-2xl md:text-3xl lg:text-4xl font-medium text-[#262626] py-6 lg:py-12">惠和安教  |  联系方式</p>
        <div class="mt-2 lg:mt-8">
          <p class="text-lg md:text-2xl mb-3 lg:mb-6 font-medium text-[#262626]">地&emsp;&emsp;址：{dreamer-cms:variable name='cfg_global_address'/}</p>
          <p class="text-lg md:text-2xl mb-3 lg:mb-6 font-medium text-[#262626]">邮&emsp;&emsp;编：{dreamer-cms:variable name='cfg_global_code'/}</p>
          <p class="text-lg md:text-2xl mb-3 lg:mb-6 font-medium text-[#262626]">联系电话：{dreamer-cms:variable name='cfg_global_telephone'/}</p>
          <p class="text-lg md:text-2xl mb-3 lg:mb-6 font-medium text-[#262626]">邮&emsp;&emsp;箱：{dreamer-cms:variable name='cfg_global_mail'/}</p>
        </div>
      </div>
      <div class="flex flex-wrap md:flex-nowrap pt-6 lg:pt-10">
        <p class="w-full md:w-[200px] text-xl mb-4  lg:mb-8  md:text-2xl font-medium text-[#262626]">交通路线</p>
        <div class="w-full md:text-lg  pb-6 lg:pb-10 ">
          <p class=" w-full">公交车&emsp;|&emsp;{dreamer-cms:variable name='cfg_global_gongjiao'/}</p>
        </div>
      </div>
      <!-- 地图 -->
      <div id="map-container" class="w-full aspect-[2/1] mt-3 lg:mt-6 mb-10"></div>
    </main>
    <!-- 页脚 -->
    {dreamer-cms:include file="inc/footer.html" /}
    <p id="position" class="hidden">{dreamer-cms:variable name='cfg_global_position'/}</p>
    <script src="https://webapi.amap.com/maps?v=2.0&key={dreamer-cms:variable name='cfg_global_amap_api_key'/}"></script>
    <!-- JavaScript -->
    <script>
      // 初始化地图
      const map = new AMap.Map('map-container', {
        zoom: 15, // 缩放级别
        center: [120.297611, 31.68149] // 无锡市惠山区文惠路116号的经纬度
      });

      // 添加标记
      const markerContent = `
        <div style="
          background: white;
          color: black;
          padding: 5px;
          width: 100px;
          text-align: center;
          border-radius: 3px;
          font-size: 14px;
        ">
          惠和安教
        </div>
      `;
      const position = document.getElementById('position').innerText;
      const marker = new AMap.Marker({
        position: position.split(','), // 标记位置
        content: markerContent, // 将 HTML 传给 content
        offset: new AMap.Pixel(-50, -65) // 以 icon 的 [center bottom] 为原点
      });
      const marker2 = new AMap.Marker({
        position: position.split(','), // 标记位置
      });
      map.add(marker);
      map.add(marker2);
    </script>
  </body>
</html>
